<?php


namespace App\Enums\OpenShop;


use App\Enums\OpenShop\InvestmentPromotion\MainProcessEnum;
use App\Models\OpenShop\Common\OpenShopOrderManagerModel;

class MissionTemplateEnum
{
    const MISSION_TYPE_1 = 1; // 审批
    const MISSION_TYPE_2 = 2; // 协办

    const MISSION_TYPE_TEXT = [
        self::MISSION_TYPE_1 => '审批',
        self::MISSION_TYPE_2 => '协办',
    ];

    // 任务所属阶段
    const MAIN_STEP_TEXT = MainProcessEnum::MAIN_PROCESS_MAP;

    const STEP_STATUS_0  = 0;  // 招商提交订单
    const STEP_STATUS_1  = 1;  // 商家待支付
    const STEP_STATUS_2  = 2;  // 商家待签署
    const STEP_STATUS_3  = 3;  // 开发待指派
    const STEP_STATUS_4  = 4;  // 选址待提交
    const STEP_STATUS_5  = 5;  // 商家待确认
    const STEP_STATUS_6  = 6;  // 建店信息待确认
    const STEP_STATUS_7  = 7;  // 设计师待指派
    const STEP_STATUS_13 = 13; // 设计模块待确认
    const STEP_STATUS_14 = 14; // 设计模块待支付
    const STEP_STATUS_15 = 15; // 设备模块待确认
    const STEP_STATUS_16 = 16; // 设备模块待支付
    const STEP_STATUS_8  = 8;  // 整套图待提交
    const STEP_STATUS_17 = 17; // 软装模块待支付
    const STEP_STATUS_9  = 9;  // 进场待确认
    const STEP_STATUS_10 = 10; // 施工待完成
    const STEP_STATUS_11 = 11; // 督导待指派
    const STEP_STATUS_12 = 12; // 督导待验收
    const STEP_STATUS_18 = 18; // 开业报告待提交

    // 自定义任务状态
    const STEP_STATUS_100 = 100; // 装修保证金待退
    const STEP_STATUS_101 = 101; // 披露单待上传
    const STEP_STATUS_102 = 102; // 已作废
    const STEP_STATUS_103 = 103;//解约
    const STEP_STATUS_104 = 104;//闭店

    const STEP_STATUS_999 = 999; // 订单完成

    const STEP_STATUS_TEXT = [
        self::STEP_STATUS_0  => '招商提交订单',
        self::STEP_STATUS_1  => '商家待支付',
        self::STEP_STATUS_2  => '商家待签署',
        self::STEP_STATUS_3  => '开发待指派',
        self::STEP_STATUS_4  => '选址待提交',
        self::STEP_STATUS_5  => '商家待确认',
        self::STEP_STATUS_6  => '建店信息待确认',
        self::STEP_STATUS_7  => '设计师待指派',
        self::STEP_STATUS_8  => '整套图待提交',
        self::STEP_STATUS_9  => '进场待确认',
        self::STEP_STATUS_10 => '施工待完成',
        self::STEP_STATUS_11 => '督导待指派',
        self::STEP_STATUS_12 => '督导待验收',
        self::STEP_STATUS_13 => '设计模块待确认',
        self::STEP_STATUS_14 => '设计模块待支付',
        self::STEP_STATUS_15 => '设备模块待确认',
        self::STEP_STATUS_16 => '设备模块待支付',
        self::STEP_STATUS_17 => '软装模块待支付',
        self::STEP_STATUS_18 => '开业报告待提交',

        self::STEP_STATUS_100 => '装修保证金待退',
        self::STEP_STATUS_101 => '披露单待上传',
        self::STEP_STATUS_102 => '已作废',

        self::STEP_STATUS_103 => "解约",
        self::STEP_STATUS_104 => "闭店",

        self::STEP_STATUS_999 => '已开业',
    ];

    const STEP_STATUS_SEARCH_KEY = [
        'default'           => 'orderStatus',
        self::STEP_STATUS_0 => 'orderStatus',
        // ... 查询条件 如果有特殊往下加
    ];

    const EXTEND_HANDLER_0 = 0; // 指派生成处理人-否
    const EXTEND_HANDLER_1 = 1; // 是

    const EXTEND_HANDLER_TEXT = [
        self::EXTEND_HANDLER_0 => '否',
        self::EXTEND_HANDLER_1 => '是',
    ];

    const HANDLER_TYPE_STAFF    = 1; // 内部员工
    const HANDLER_TYPE_MERCHANT = 2; // 商家

    const HANDLER_TYPE_TEXT = [
        self::HANDLER_TYPE_STAFF    => '内部员工',
        self::HANDLER_TYPE_MERCHANT => '商家',
    ];


    const HANDLER_ROLE_1 = 1; // 开发负责人
    const HANDLER_ROLE_2 = 2; // 筹备负责人
    const HANDLER_ROLE_3 = 3; // 设计负责人
    const HANDLER_ROLE_4 = 4; // 营运负责人

    const HANDLER_ROLE_TEXT = [
        self::HANDLER_ROLE_1 => '开发负责人',
        self::HANDLER_ROLE_2 => '筹备负责人',
        self::HANDLER_ROLE_3 => '设计负责人',
        self::HANDLER_ROLE_4 => '营运负责人',
    ];

    const HANDLER_ROLE_COLUMN = [
        self::HANDLER_ROLE_1 => 'developUid',
        self::HANDLER_ROLE_2 => 'preparationUid',
        self::HANDLER_ROLE_3 => 'designerUid',
        self::HANDLER_ROLE_4 => 'operationUid',
    ];

    const HANDLER_ROLE_TO_MANAGER_TYPE = [
        self::HANDLER_ROLE_1 => OpenShopOrderManagerModel::MANAGER_TYPE_2,
        self::HANDLER_ROLE_2 => OpenShopOrderManagerModel::MANAGER_TYPE_4,
        self::HANDLER_ROLE_3 => OpenShopOrderManagerModel::MANAGER_TYPE_3,
        self::HANDLER_ROLE_4 => OpenShopOrderManagerModel::MANAGER_TYPE_5,
    ];

    const MANAGER_TYPE_TO_HANDLER_ROLE = [
        OpenShopOrderManagerModel::MANAGER_TYPE_2 => self::HANDLER_ROLE_1,
        OpenShopOrderManagerModel::MANAGER_TYPE_4 => self::HANDLER_ROLE_2,
        OpenShopOrderManagerModel::MANAGER_TYPE_3 => self::HANDLER_ROLE_3,
        OpenShopOrderManagerModel::MANAGER_TYPE_5 => self::HANDLER_ROLE_4,
    ];

    const HANDLER_RULE_AREA  = 1; // 属地指派
    const HANDLER_RULE_HQ    = 2; // 总部指派
    const HANDLER_RULE_ORDER = 3; // 订单指派

    const HANDLER_RULE_TEXT = [
        self::HANDLER_RULE_AREA  => '属地指派',
        self::HANDLER_RULE_HQ    => '总部指派',
        self::HANDLER_RULE_ORDER => '订单指派',
    ];

    // 开店小程序 - 选址中状态
    const SITE_STATUS = [
        MissionTemplateEnum::STEP_STATUS_3,
        MissionTemplateEnum::STEP_STATUS_4,
        MissionTemplateEnum::STEP_STATUS_5
    ];

    // 开店小程序 - 筹备中状态
    const PREPARE_STATUS = [
        MissionTemplateEnum::STEP_STATUS_6,
        MissionTemplateEnum::STEP_STATUS_7,
        MissionTemplateEnum::STEP_STATUS_13,
        MissionTemplateEnum::STEP_STATUS_14,
        MissionTemplateEnum::STEP_STATUS_15,
        MissionTemplateEnum::STEP_STATUS_16,
        MissionTemplateEnum::STEP_STATUS_8,
        MissionTemplateEnum::STEP_STATUS_17,
        MissionTemplateEnum::STEP_STATUS_9,
        MissionTemplateEnum::STEP_STATUS_10,
        MissionTemplateEnum::STEP_STATUS_11,
        MissionTemplateEnum::STEP_STATUS_12,
    ];

    // 开店小程序任务列表支持的类型
    const OPEN_MISSION_LISTS = [
        MissionTemplateEnum::STEP_STATUS_3,
        MissionTemplateEnum::STEP_STATUS_6,
        MissionTemplateEnum::STEP_STATUS_9,
        MissionTemplateEnum::STEP_STATUS_10,
        MissionTemplateEnum::STEP_STATUS_11,
        MissionTemplateEnum::STEP_STATUS_12,
        MissionTemplateEnum::STEP_STATUS_18,
    ];

    // 选址小程序任务列表支持的类型
    const SITE_LOCATION_LISTS = [
        self::STEP_STATUS_4,
    ];

    //筹备中状态
    const PREPARE_STATUS_TEXT = [
        self::STEP_STATUS_6  => '建店信息待确认',
        self::STEP_STATUS_7  => '设计师待指派',
        self::STEP_STATUS_8  => '整套图待提交',
        self::STEP_STATUS_9  => '进场待确认',
        self::STEP_STATUS_10 => '施工待完成',
        self::STEP_STATUS_11 => '督导待指派',
        self::STEP_STATUS_13 => '设计模块待确认',
        self::STEP_STATUS_14 => '设计模块待支付',
        self::STEP_STATUS_15 => '设备模块待确认',
        self::STEP_STATUS_16 => '设备模块待支付',
        self::STEP_STATUS_17 => '软装模块待支付',
    ];

    // 开店小程序 - 筹备中状态-剔除  督导待验收 任务阶段
    const PREPARE_STATUS_NEW = [
        MissionTemplateEnum::STEP_STATUS_6,
        MissionTemplateEnum::STEP_STATUS_7,
        MissionTemplateEnum::STEP_STATUS_13,
        MissionTemplateEnum::STEP_STATUS_14,
        MissionTemplateEnum::STEP_STATUS_15,
        MissionTemplateEnum::STEP_STATUS_16,
        MissionTemplateEnum::STEP_STATUS_8,
        MissionTemplateEnum::STEP_STATUS_17,
        MissionTemplateEnum::STEP_STATUS_9,
        MissionTemplateEnum::STEP_STATUS_10,
        MissionTemplateEnum::STEP_STATUS_11,
    ];
}
